package com.sxyjhh.dbutil.basic;

/**
 * Description：常量配置类
 *
 * @JDK Version:1.8.0_40
 * Version: V1.0
 * Author: wangchun
 * Date: 2016/3/22 13:30
 */
public class ConstConfig {

    public enum DBType {
        ORACLE(1),
        DAMENG(2),
        MYSQL(3),
        SQLSERVER(4);//    调用构造函数来构造枚举项

        private int value = 0;

        DBType(int value) {    // 必须是private的，否则编译错误
            this.value = value;
        }

        public static DBType valueOf(int value) {    //    手写的从int到enum的转换函数

            switch (value) {
                case 1:
                    return ORACLE;
                case 2:
                    return DAMENG;
                case 3:
                    return MYSQL;
                case 4:
                    return SQLSERVER;
                default:
                    return null;
            }
        }

        public int value() {
            return this.value;
        }
    }

    /**
     * 数据库业务请求类型
     */
    public interface DBReqType{
        String REQ_TABLE_CLOUMN = "REQ_TABLE_CLOUMN";   //获取字段
        String REQ_TABLE_DATA = "REQ_TABLE_DATA";     //获取表数据
        String REQ_INSERT_DATA = "REQ_INSERT_DATA";     //插入数据
    }

    public interface SeparatorChar{
        String sColumSepar = ","; //列名分隔符
        String sTableSepar = ","; //表分隔符
    }

}
